import hooks from './hooks'
export default {
  mode: 'spa',
  /*
   ** Headers of the page
   */
  head: {
    title: process.env.npm_package_name || '',
    meta: [{
        charset: 'utf-8'
      },
      {
        name: 'viewport',
        content: 'width=device-width, initial-scale=1'
      },
      {
        hid: 'description',
        name: 'description',
        content: process.env.npm_package_description || ''
      }
    ],
    link: [{
      rel: 'icon',
      type: 'image/x-icon',
      href: '/favicon.ico'
    }]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: {
    color: '#fff'
  },
  /*
   ** Global CSS
   */
  css: [
    'element-ui/lib/theme-chalk/index.css'
  ],
  /*
   ** Plugins to load before mounting the App
   */
  plugins: [
    '@/plugins/element-ui'
  ],
  /*
   ** Nuxt.js modules
   */
  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios',
    '@nuxtjs/pwa',
    '@nuxtjs/auth',
    '@nuxtjs/style-resources',
    "@nuxtjs/proxy"
  ],
  proxy: {
    '/api': 'http://localhost:5005',
    '/Identity': 'http://localhost:5005',
  },
  styleResources: {
    scss: [
      './assets/vars/*.scss',
      './assets/abstracts/_mixins.scss'
    ]
  },
  auth: {
    // Options
    strategies: {
      local: {
        endpoints: {
          login: {
            url: '/api/oauth/login',
            method: 'post'
          },
          user: {
            url: '/api/oauth/user',
            method: 'get'
          }

        },
        tokenRequired: false,
        tokenType: false
      }
    }
  },
  /*
   ** Axios module configuration
   ** See https://axios.nuxtjs.org/options
   */
  axios: {
    baseUrl: 'http://localhost:5005',
  },
  /*
   ** Build configuration
   */
  build: {
    transpile: [/^element-ui/],
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {

      var path = require('path')
      Object.assign(config.resolve.alias, {
        'utils': path.resolve(__dirname, 'utils'),
        'styles': path.join(__dirname, 'styles'),
      })

    }
  },
  generate: {
    dir: "../src/wwwroot/app"
  },
  router: {
    base: '/app/'
  },
  hooks: hooks(this)
}
